<template>
  <div class="about">
    <div class="about-container">
      <!-- 主体内容卡片 -->
      <div class="about-card animate-fade-in-up">
        <div class="decorative-bar animate-slide-in-left"></div>
        <div class="content animate-fade-in-up" style="animation-delay: 0.2s">
          <MdViewer :value="aboutContent" />
        </div>
      </div>
      <!-- 版权信息 -->
      <div class="copyright animate-fade-in" style="animation-delay: 0.4s">
        © {{ new Date().getFullYear() }} DPan. All rights reserved.
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import MdViewer from "@/components/common/MdViewer.vue";
import { aboutContent } from "@/assets/about";
</script>

<style scoped>
/* 基础布局样式 */
.about { min-height: calc(100vh - 64px); background: #ffffff; padding: 0; }
.about-container { max-width: 64rem; margin: 0 auto; padding: 2rem 1rem 3rem; }
.about-card { background: white; border-radius: 0.5rem; box-shadow: 0 4px 20px rgba(0,0,0,0.05); overflow: hidden; border: 1px solid rgba(0,0,0,0.03); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.decorative-bar { height: 0.25rem; background: linear-gradient(90deg, #4f46e5, #06b6d4); width: 0; }
.content { padding: 2rem 3rem; }
.copyright { text-align: center; color: #64748b; font-size: 0.875rem; margin-top: 1.5rem; }

/* Markdown 内容样式 */
:deep(.markdown-body) { color: #334155; transition: opacity 0.5s ease; }
:deep(.markdown-body h1) { font-size: 2rem; font-weight: 700; color: #1e293b; margin: 0 0 1.75rem; padding-bottom: 1rem; border-bottom: 1px solid #e2e8f0; }
:deep(.markdown-body h2) { font-size: 1.5rem; font-weight: 600; color: #334155; margin: 2.5rem 0 1.25rem; }
:deep(.markdown-body ul) { margin: 1.25rem 0; padding-left: 1.75rem; list-style-type: disc; }
:deep(.markdown-body li) { color: #475569; line-height: 1.75; margin-bottom: 0.75rem; }
:deep(.markdown-body p) { line-height: 1.75; margin-bottom: 1.25rem; color: #475569; }
:deep(.markdown-body a) { color: #4f46e5; text-decoration: none; transition: all 0.2s; position: relative; }
:deep(.markdown-body a::after) { content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px; background: #4338ca; transition: width 0.2s; }
:deep(.markdown-body a:hover) { color: #4338ca; }
:deep(.markdown-body a:hover::after) { width: 100%; }

/* 动画类与关键帧 */
.animate-fade-in { animation: fadeIn 0.8s ease forwards; opacity: 0; }
.animate-fade-in-up { animation: fadeInUp 0.8s ease forwards; opacity: 0; transform: translateY(20px); }
.animate-slide-in-left { animation: slideInLeft 0.8s ease forwards 0.1s; }
.about-card:hover { transform: translateY(-5px); box-shadow: 0 8px 30px rgba(0,0,0,0.12); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { to { width: 100%; } }

/* 响应式适配 - 平板及以下 */
@media (max-width: 768px) {
  .about-container { padding: 1rem 1rem 2rem; }
  .content { padding: 1.5rem; }
  :deep(.markdown-body h1) { font-size: 1.5rem; margin-bottom: 1.25rem; }
  :deep(.markdown-body h2) { font-size: 1.25rem; margin-top: 2rem; }
  :deep(.markdown-body) { font-size: 0.9375rem; }
  .copyright { margin-top: 1rem; font-size: 0.8125rem; }
}

/* 响应式适配 - 小屏手机 */
@media (max-width: 480px) {
  .content { padding: 1.25rem 1rem; }
  :deep(.markdown-body h1) { padding-bottom: 0.75rem; }
  :deep(.markdown-body ul) { padding-left: 1.5rem; margin: 1rem 0; }
  :deep(.markdown-body li) { margin-bottom: 0.5rem; line-height: 1.6; }
}
</style>